/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.targeter.rulesengine.model.impl;

import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.CacheModel;

import com.targeter.rulesengine.model.rules;

import java.io.Serializable;

/**
 * The cache model class for representing rules in entity cache.
 *
 * @author jsalaice
 * @see rules
 * @generated
 */
public class rulesCacheModel implements CacheModel<rules>, Serializable {
	@Override
	public String toString() {
		StringBundler sb = new StringBundler(11);

		sb.append("{ruleId=");
		sb.append(ruleId);
		sb.append(", model=");
		sb.append(model);
		sb.append(", ruleName=");
		sb.append(ruleName);
		sb.append(", active=");
		sb.append(active);
		sb.append(", drlFile=");
		sb.append(drlFile);
		sb.append("}");

		return sb.toString();
	}

	public rules toEntityModel() {
		rulesImpl rulesImpl = new rulesImpl();

		rulesImpl.setRuleId(ruleId);

		if (model == null) {
			rulesImpl.setModel(StringPool.BLANK);
		}
		else {
			rulesImpl.setModel(model);
		}

		if (ruleName == null) {
			rulesImpl.setRuleName(StringPool.BLANK);
		}
		else {
			rulesImpl.setRuleName(ruleName);
		}

		rulesImpl.setActive(active);

		if (drlFile == null) {
			rulesImpl.setDrlFile(StringPool.BLANK);
		}
		else {
			rulesImpl.setDrlFile(drlFile);
		}

		rulesImpl.resetOriginalValues();

		return rulesImpl;
	}

	public long ruleId;
	public String model;
	public String ruleName;
	public boolean active;
	public String drlFile;
}